<?#//v.3.1.1
require('../includes/config.inc.php');
include "loggedin.inc.php";

#///////////////////////////////////////////////////////
#//  COPYRIGHT 2002 PHPAuction.org ALL RIGHTS RESERVED//
#//  For Source code for the GPL version go to        //
#//  http://phpauction.org and download               //
#///////////////////////////////////////////////////////

if($_POST['action'] == "start" && phpa_securepost($_POST)) {
	if(!file_exists("categories.txt")) {
		$ERR = $ERR_118;
	} else {
		Header("Location: populate_categories.php");
	}
}

#// Check if there are existing auctions
$AUCTIONS = mysql_num_rows(@mysql_query("SELECT id FROM PHPAUCTIONXL_auctions"));


?>
<HTML>
<HEAD>
<link rel='stylesheet' type='text/css' href='style.css' />
<SCRIPT Language=Javascript>
function window_open(pagina,titulo,ancho,largo,x,y){
	var Ventana= 'toolbar=0,location=0,directories=0,scrollbars=1,screenX='+x+',screenY='+y+',status=0,menubar=0,resizable=0,width='+ancho+',height='+largo;
	open(pagina,titulo,Ventana);
	
}
</SCRIPT>
<link href="css/main.css" rel="stylesheet" type="text/css">
</HEAD>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="titulo">
        <tr>
          <td class="icono"><img src="images/settings_icon2.gif" width="30" height="29"></td>
          <td class="breadcrumbs"><p><span><?=$MSG_25_0007?></span>&nbsp;&gt;&gt;&nbsp;<?=$MSG_369?></p></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="middle"><TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0 BGCOLOR="#FFFFFF">
        <TR>
          <TD ALIGN=CENTER><BR>
            <FORM NAME=conf ACTION=<?=basename($_SERVER['PHP_SELF'])?> METHOD=POST>
              <TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="0" class="base" style="border:1px solid #ccc;">
                <TR>
                  <TD  class=title><p><? print $MSG_369; ?></p></TD>
                </TR>
                <TR>
                  <TD><TABLE WIDTH=100% ALIGN="CENTER" CELLPADDING=0 cellspacing="0" BGCOLOR="#FFFFFF">
                      <TR>
                        <TD HEIGHT="21" colspan="5" class="error"> <p>
                          <?=$ERR?>
                          <BR>
                          <BR>
                          <?=$MSG_644; ?>
                        </p></TD>
                      </TR>
                      <TR>
                        <TD WIDTH=63></TD>
                        <TD WIDTH="903">
                          <? 
                          if($AUCTIONS == 0) {
                          	print $MSG_405;
                          	if($$ERR) {
                          		print "<FONT COLOR=red><BR><BR>".$$ERR;
                          	} else {
                          		if($$MSG) {
                          			print "<FONT COLOR=red><BR><BR>".$$MSG;
                          		} else {
                          			print "<BR><BR>";
                          		}
                          	}
                          } else {
                          	print $MGS_2__0011;
                          }
						  ?>                        </TD>
                      </TR>
                      <TR>
                        <TD COLSPAN="2" HEIGHT="22" ALIGN=CENTER>
                        <?
                        if($AUCTIONS == 0) {
						?>
                          <CENTER>
                            <INPUT TYPE=hidden NAME=action VALUE=start>
							<INPUT TYPE="hidden" NAME="security" VALUE="<?php echo $_SESSION['security'];?>" />
                            <INPUT TYPE="submit" NAME="Submit" VALUE="<?=$MSG_406?>" class="action">
                          </CENTER>
                          <?
                        } else {
                        	print "<BR><BR>".$MGS_2__0071;
                        }
						?>                        </TD>
                      </TR>
                      <TR>
                        <TD WIDTH=63></TD>
                        <TD WIDTH="903"></TD>
                      </TR>
                    </TABLE></TD>
                </TR>
              </TABLE>
            </FORM><br></TD>
        </TR>
      </TABLE></TD>
  </TR>
</TABLE>
</BODY>
</HTML>
